<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body>div{
            width: 200px;
            border: 1px solid red;
            /*当母容器的子元素要设置为浮动定位时,也就是这里div1-3*/
            /*母容器 需要设置overflow: hidden*/
            overflow: hidden;
        }
        #d1{
            width: 50px;
            height: 50px;
            background-color: red;
            float: right;
        }
        #d2{
            width: 50px;
            height: 50px;
            background-color: green;
            float: right;
        }
        #d3{
            width: 50px;
            height: 50px;
            background-color: blue;
            float: right;/*left*/
        }
        ul{
            list-style-type: none;/*去掉每行开头的圆点符号*/
            padding:0;
            margin:0;
            overflow: hidden;
        }
        li{
            /*左侧浮动 已变成横向排列*/
            float: right;
            /*设置元素横向间距*/
            margin-right: 20px;
        }
    </style>
</head>
<body>
<ul>
    <li><a href="">首页</a> </li>
    <li><a href="">免费课</a> </li>
    <li><a href="">直播课</a> </li>
    <li><a href="">精品课</a> </li>
    <li><a href="">线上课</a> </li>
</ul>
<div>
    <div id="d1">div1</div>
    <div id="d2">div2</div>
    <div id="d3">div3</div>
</div>
</body>
</html>